<?php /*a:1:{s:94:"D:\phpstudy_pro\WWW\git\DSMall\app\home\view\default\base\editable_page_model\model_image.html";i:1591845925;}*/ ?>
<div class='editable-page-model'>
<form id="editable_model_form" action="<?php echo htmlentities(app('request')->url()); ?>">
<div class="dssc-form-goods-pic">
<div class="dssc-goodspic-list">

<ul>
    <?php $__FOR_START_359766542__=0;$__FOR_END_359766542__=$image_info['count'];for($i=$__FOR_START_359766542__;$i < $__FOR_END_359766542__;$i+=1){ ?>
    <li class="dssc-goodspic-upload">
        <div class="upload-thumb"><img src="<?php if(isset($image_info['list'][$i]) && $image_info['list'][$i]['path']): ?><?php echo htmlentities($image_info['list'][$i]['path']); else: ?><?php echo goods_thumb(); ?><?php endif; ?>" dstype="file_<?php echo htmlentities($i); ?>">
            <input type="hidden" name="img[<?php echo htmlentities($i); ?>][path]" value="<?php if(isset($image_info['list'][$i]) && $image_info['list'][$i]['path']): ?><?php echo htmlentities($image_info['list'][$i]['path']); ?><?php endif; ?>" dstype="path_<?php echo htmlentities($i); ?>">
        </div>
        <div class="show-sort"><?php echo htmlentities(lang('ds_sort')); ?>：
            <input name="img[<?php echo htmlentities($i); ?>][sort]" type="text" class="text" value="<?php if(isset($image_info['list'][$i]) && $image_info['list'][$i]['sort']): ?><?php echo htmlentities($image_info['list'][$i]['sort']); else: ?>9<?php endif; ?>" size="1" maxlength="1">
        </div>
        <div class="dssc-upload-btn"><a href="javascript:void(0);"><span><input type="file" hidefocus="true" size="1" class="input-file" name="file_<?php echo htmlentities($i); ?>" id="file_<?php echo htmlentities($i); ?>" onchange="ajaxFileUpload(<?php echo htmlentities($i); ?>)"></span><p><i class="iconfont">&#xe733;</i><?php echo htmlentities(lang('ds_upload')); ?></p>
            </a>
        </div>
    </li>
    <?php } ?>
</ul>
<div class='tc pb20 pt20'><a class="dssc-btn" dstype="select-124" href="javascript:void(0)" onclick="submitEditableModelForm()"><?php echo htmlentities(lang('ds_submit')); ?></a></div>

</div>
</div>
</form>
</div>    
<script>
    
// 图片上传ajax
function ajaxFileUpload(id) {
    $.ajaxFileUpload({
        url : EDITABLE_PAGE_URL+'/image_upload',
        secureuri : false,
        fileElementId : 'file_'+id,
        dataType : 'json',
        data : {name:'file_'+id,config_id : <?php echo htmlentities(app('request')->param('config_id')); ?>},
        success : function (data, status) {
                    if (data.code!=10000) {
                        layer.msg(data.message);
                    } else {
                        $('input[dstype="path_' + id + '"]').val(data.result.file_path);
                        $('input[dstype="id_' + id + '"]').val(data.result.file_id);
                        $('img[dstype="file_' + id + '"]').attr('src', data.result.file_path);
                    }

                }
    });
    return false;

}
</script>

